package com.qiangqiang.entity;

import javax.persistence.*;

/**
 * Created by q on 2018/4/10.
 */
@Entity
@Table(name = "student", schema = "student", catalog = "")
public class StudentEntity {
    private String stuId;
    private String name;
    private Integer totCret;

    @Id
    @Column(name = "stu_id")
    public String getStuId() {
        return stuId;
    }

    public void setStuId(String stuId) {
        this.stuId = stuId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "tot_cret")
    public Integer getTotCret() {
        return totCret;
    }

    public void setTotCret(Integer totCret) {
        this.totCret = totCret;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StudentEntity that = (StudentEntity) o;

        if (stuId != null ? !stuId.equals(that.stuId) : that.stuId != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (totCret != null ? !totCret.equals(that.totCret) : that.totCret != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = stuId != null ? stuId.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (totCret != null ? totCret.hashCode() : 0);
        return result;
    }
}
